var t = getApp(), n = t.http.host_listPost, o = t.http.host_changePost;
var util = t.util
Page({
    data: {
        hostList: null
    },
    onLoad: function(t) {
        wx.hideShareMenu();//禁止分享
    },
    onReady: function() {},
    onShow: function() {
        this.hostList();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    hostList: function() {
        var t = this, o = wx.getStorageSync("userinfo").token, e = wx.getStorageSync("hall_info").id;
        var roles = 1;
        if (wx.getStorageSync("userinfo").uid == wx.getStorageSync("dangqiInfo").manager_id){
          roles = 2;
        }
        n({
            token: o,
            roles,
            hall_id: e
        }).then(function(n) {
            0 == n.code ? t.setData({
                hostList: n.data
            }) : console.log("接口返回数据失败", n);
        });
    },
    setuid: function(t) {
        var n = t.detail.nickname, e = t.detail.uid, a = wx.getStorageSync("dangqiInfo"), i = wx.getStorageSync("userinfo").token;
        o({
            token: i,
            hall_id:wx.getStorageSync("hall_info").id,
            qid: a.id,
            manager_id: e
        }).then(function(t) {
            if (0 == t.code) {
                a.manager = n, a.manager_id = e;
                try {
                    wx.setStorageSync("dangqiInfo", a);
                } catch (t) {
                    console.log("本地存储失败", t);
                }
                var o = getCurrentPages(), i = o[o.length - 2];
                i.data;
                i.setData({
                    manager: n
                }), wx.navigateBack({
                    delta: 1
                });
            } else console.log("接口返回数据失败", t);
        });
    }
});